package com.wuxin.ssm.service.impl;


import com.wuxin.ssm.entity.Address;
import com.wuxin.ssm.entity.AddressExample;
import com.wuxin.ssm.mapper.AddressMapper;
import com.wuxin.ssm.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @program: ssmwork
 * @ClassName AddressServiceImpl
 * @description:
 * @author: 李尧坤
 * @create: 2024−12-20 19:26
 * @Version 1.0
 **/
@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressMapper addressMapper;


    @Override
    public List<Address> findAddressByid(Integer uid) {
        AddressExample example = new AddressExample();
        example.createCriteria().andUidEqualTo(uid);
        List<Address> addressList = addressMapper.selectByExample(example);
        return addressList;
    }

    @Override
    public void insertAddress(Address address) {
        addressMapper.insertSelective(address);
    }
}
